<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('超期未返回查询')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li class="select-time">
                            <label style="width: 100px;">申请外包日期：</label>
                            <input type="text" class="time-input" placeholder="开始时间" name="oqcDateBegin" style="width: 100px;"/>
                            <span>~</span>
                            <input type="text" class="time-input" placeholder="结束时间" name="oqcDateEnd" style="width: 100px;"/>
                        </li>
                        <li class="select-time">
                            <label>发货日期：</label>
                            <input type="text" class="time-input" placeholder="发货开始日期" name="deliveryDateBegin" style="width: 100px;"/>
                            <span>~</span>
                            <input type="text" class="time-input" placeholder="发货结束日期" name="deliveryDateEnd" style="width: 100px;"/>
                        </li>
                        <li>
                            外包状态：
                            <select name="poStatus" >
                                <option value="">所有</option>
                                <option value="3">已发货</option>
                                <option value="4">已返回</option>
                                <option value="5">部分返回</option>
                            </select>
                        </li>
                        <li>
                            超期天数 > ：
                            <input type="text" name="overDays"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="query()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="outsource:overplandatereturn:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped" style="white-space: nowrap;">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var tableinit = true;
    var os_appoint_site = [[${@dict.getType('os_appoint_site')}]];
    var po_status = [[${@dict.getType('po_status')}]];
    var prefix = ctx + "outsource/overplandatereturn";

    var columns =  [
        {
            field: 'NO',
            align : 'center',
            title: 'NO',
            formatter: function (value, row, index) {
                return $.table.serialNumber(index);
            }
        },
        {
            field: 'id',
            title: 'UUID',
            visible: false
        },
        {
            field: 'lotId',
            title: '批号',
            width: 80
        },
        {
            field: 'partType',
            title: '产品类型',
            width: 100
        },
        {
            field: 'partName',
            title: '产品名称',
            width: 200,
            sortable: true
        },
        {
            field: 'stageDesc',
            title: '外包工步',
            width: 200,
            sortable: true
        },
        {
            field: 'outsourceSeq',
            title: '当前外包次号',
            width: 200
        },
        {
            field: 'seq',
            title: '当前工步',
            width: 200
        },
        {
            field: 'outsourceCount',
            title: '外包数量',
            width: 50
        },
        {
            field: 'chipNumber',
            title: '片号',
            width: 80
        },
        {
            field: 'oqcDate',
            title: '申请外包日期',
            width: 120,
            sortable: true
        },
        {
            field: 'deliveryDate',
            title: '发货日期',
            width: 120,
            sortable: true
        },
        {
            field: 'returnCount',
            title: '返回数量',
            width: 80
        },
        {
            field: 'actualReturnDate',
            title: '实际返回日期',
            width: 120,
            sortable: true
        },
        {
            field: 'outsourceCycleTime',
            title: '外包周期',
            width: 80,
            sortable: true
        },
        {
            field: 'sentOutsourceCycleTime',
            title: '已送外包周期',
            width: 80,
            sortable: true
        },
        {
            field: 'appointSite',
            title: '指定场所',
            width: 80,
            formatter: function(value, row, index) {
                return $.table.selectDictLabel(os_appoint_site, value);
            },
            sortable: true
        },
        {
            field: 'expressNumber',
            title: '快递单号',
            width: 150
        },
        {
            field: 'poStatus',
            title: '当前状态',
            width: 80,
            formatter: function(value, row, index) {
                return $.table.selectDictLabel(po_status, value);
            }
        },
        {
            field: 'planReturnDate',
            title: '预计返回日期',
            width: 120
        },
        {
            field: 'planOutsourceCycleTime',
            title: '预计外包周期',
            width: 80
        },
        {
            field: 'issueNotes',
            title: '外包前检验备注',
            width: 80
        }
    ];

    var options = {
        url: prefix + "/list",
        exportUrl: prefix + "/export",
        modalName: "超期未返回查询",
        columns: columns,
        showSearch: false,
        showRefresh: false,
        showToggle: false,
        showColumns: true,
        sidePagination: "client"
    };

    $(function() {
    });

    function query() {
        if (tableinit) {
            $.table.init(options);
            tableinit = false;
        } else {
            $.table.search();
        }
    }

</script>
</body>
</html>